home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: news.sprintlink.net!news1!ind-003-236-135
- From: dlmiller@iquest.net (Doug Miller)
- Subject: Re: prototype error
- X-Nntp-Posting-Host: ind-003-236-135.iquest.net
- Message-ID: <DoBAnD.KrG@iquest.net>
- Sender: news@iquest.net (News Admin)
- Organization: IQuest Network Services
- X-Newsreader: News Xpress Version 1.0 Beta #2.1
- References: <4i8688$1gr@cloner4.netcom.com>
- Date: Fri, 15 Mar 1996 13:57:02 GMT
-
- brenth@ix.netcom.com(harold brent hyatt) wrote:
-
- +I copied this program from a C primer and get an error as follows:
- +"Call to function sound, delay, nosound with no prototype."
- +I'm using a Borland 3.1 C++ compiler in the EasyWin mode. I have
- +tried switching the compiler from ANSI to Borland C++, but with the
- +same result. What's wrong? Thanks.
- +
- +#include <stdio.h>
-
- Possibly the lack of a space between '#include' and '<' on the next two lines.
- BTW -- this program compiles clean as written under Borland TurboC++ v2.0.
-
- +#include<conio.h>
- +#include<dos.h>
- +
- +void dropBomb (void);
- +
- +main()
- +{
- + printf("Press any key to drop bomb:\n");
- + getch();
- + dropBomb();
- + printf("\nYikes!\n");
- +}
- +void dropBomb()
- +{
- + int x;
- +
- + for(x=880;x>440;x-=10)
- + {
- + sound(x);
- + delay(100);
- + }
- + nosound();
- +}
-
-